<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>阴影移动效果</title>
    <style>
        body{
            background-color:rgb(226, 223, 223);
        }
        .box1{
            width: 200px;
            height: 300px;
            background-color: whitesmoke;
            /*加一个过渡效果*/
            /* transition: transform 0.5s; */
            transition: all 0.3s;
        }
        .box1:hover{
            transform: translateY(-1px);
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
          
        }

    </style>
</head>
<body>
    <div class="box1"></div>
</body>
</html>